/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package nuevoingresoA;

import conexion.Conexion;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author PACHITO
 */
@WebServlet(name = "alumnosnuevoingreso", urlPatterns = {"/alumnosnuevoingreso"})
public class alumnosnuevoingreso extends HttpServlet {

    ResultSet cdr = null;
    Conexion conecta = new Conexion();
    Statement sentenciaSQL = null;

    @Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        conecta.Conectar();
        sentenciaSQL = conecta.getSentenciaSQL();
    }

    /**
     * Processes requests for both HTTP
     * <code>GET</code> and
     * <code>POST</code> methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
    }

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /**
     * Handles the HTTP
     * <code>GET</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        int no = Integer.parseInt(request.getParameter("selecnivel"));
        if (no == 0) {
            out.print("seleccionar nivel educativo");
        }
        if (no == 1) {
            out.println("<select id=\"grupo\">\n"
                    + "<option value=\"0\" >seleccionar...</option>\n"
                    + "<option value=\"1\" >A</option>\n"
                    + "<option value=\"2\" >B</option>\n"
                    + "</select>");
            
        }
        if (no == 2) {
            out.println("<select id=\"grupo\">\n"
                    + "<option value=\"0\" >seleccionar...</option>\n"
                    + "<option value=\"1\" >1</option>\n"
                    + "<option value=\"2\" >2</option>\n"
                    + "<option value=\"3\" >3</option>\n"
                    + "<option value=\"4\" >4</option>\n"
                    + "<option value=\"5\" >5</option>\n"
                    + "<option value=\"6\" >6</option>\n"
                    + "</select>");
            
        }
        if (no == 3) {
            out.println("<select id=\"grupo\">\n"
                    + "<option value=\"0\" >seleccionar...</option>\n"
                    + "<option value=\"1\" >1</option>\n"
                    + "<option value=\"2\" >2</option>\n"
                    + "<option value=\"3\" >3</option>\n"
                    + "</select>");
            
        }
        if (no == 4) {
            out.println("<select id=\"grupo\">\n"
                    + "<option value=\"0\" >seleccionar...</option>\n"
                    + "<option value=\"1\" >101</option>\n"
                    + "<option value=\"2\" >201</option>\n"
                    + "<option value=\"3\" >301</option>\n"
                    + "<option value=\"4\" >401</option>\n"
                    + "<option value=\"5\" >402</option>\n"
                    + "<option value=\"6\" >501</option>\n"
                    + "<option value=\"7\" >502</option>\n"
                    + "<option value=\"8\" >503</option>\n"
                    + "</select>");
            
        }
        if (no == 5) {
            out.println("<select id=\"grupo\">\n"
                    + "<option value=\"0\" >seleccionar...</option>\n"
                    + "<option value=\"1\" >101</option>\n"
                    + "<option value=\"2\" >201</option>\n"
                    + "<option value=\"3\" >301</option>\n"
                    + "<option value=\"4\" >401</option>\n"
                    + "<option value=\"5\" >402</option>\n"
                    + "<option value=\"6\" >501</option>\n"
                    + "<option value=\"7\" >502</option>\n"
                    + "<option value=\"8\" >503</option>\n"
                    + "</select>");
            
        }
        if (no == 6) {
            out.println("<select id=\"grupo\">\n"
                    + "<option value=\"0\" >seleccionar...</option>\n"
                    + "<option value=\"1\" >1 cuatrimestre</option>\n"
                    + "<option value=\"2\" >2 cuatrimestre</option>\n"
                    + "<option value=\"3\" >3 cuatrimestre</option>\n"
                    + "<option value=\"4\" >4 cuatrimestre</option>\n"
                    + "<option value=\"5\" >4 cuatrimestre</option>\n"
                    + "<option value=\"6\" >5 cuatrimestre</option>\n"
                    + "<option value=\"7\" >6 cuatrimestre</option>\n"
                    + "<option value=\"8\" >7 cuatrimestre</option>\n"
                    + "<option value=\"9\" >8 cuatrimestre</option>\n"
                    + "<option value=\"10\" >9 cuatrimestre</option>\n"
                    + "<option value=\"11\" >10 cuatrimestre</option>\n"
                    + "</select>");
            
        }
        if (no == 7) {
            out.println("<select id=\"grupo\">\n"
                    + "<option value=\"0\" >seleccionar...</option>\n"
                    + "<option value=\"1\" >1 cuatrimestre</option>\n"
                    + "<option value=\"2\" >2 cuatrimestre</option>\n"
                    + "<option value=\"3\" >3 cuatrimestre</option>\n"
                    + "<option value=\"4\" >4 cuatrimestre</option>\n"
                    + "<option value=\"5\" >4 cuatrimestre</option>\n"
                    + "<option value=\"6\" >5 cuatrimestre</option>\n"
                    + "<option value=\"7\" >6 cuatrimestre</option>\n"
                    + "</select>");
            
        }
        
//        if (no == 1 || no == 2 || no == 3) {
//            out.println("<select id=\"grupo\">\n"
//                    + "<option value=\"0\" >seleccionar...</option>\n"
//                    + "<option value=\"1\" >A</option>\n"
//                    + "<option value=\"2\" >B</option>\n"
//                    + "<option value=\"3\">C</option>\n"
//                    + "</select>");
//        }
//        if (no == 4 || no == 5 || no == 6 || no == 7 || no == 8) {
//            out.println("<select id=\"grupo\">\n"
//                    + "<option value=\"0\" >seleccionar...</option>\n"
//                    + "<option value=\"1\" >101</option>\n"
//                    + "<option value=\"2\">102</option>\n"
//                    + "<option value=\"3\">103</option>\n"
//                    + "</select>");
//        }
//

    }

    /**
     * Handles the HTTP
     * <code>POST</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>
}
